<template>
  <div>
    {{ num}} -- {{num1 }}
    <button @click="update">修改</button>
  </div>
</template>

<script lang="ts" setup name="Person">
  import { ref, watch, watchEffect } from 'vue'

  let num = ref(0)
  let num1 = ref(100)
  function update() {
    num.value++
    num1.value++
  }

  watch([num, num1], (newval, oldval) => {
    console.log('newval,oldval--', newval, oldval)
  })

  watchEffect(() => {
    console.log('watchEffect--', num.value)
  })
</script>
